/**
 * Copyright © 2020 易久批信息技术有限公司. All rights reserved.
 */
package com.dysm.composite;

/**
 * 组合模式
 * @author xiay
 * @since 2020/12/12 8:40 下午
 */
public class CompositeClient {

    public static void main(String[] args) {
        FileInterface file1 = new ImageFile("we.jpg");

        FileInterface file2 = new VideoFile("2012.mp4");

        FileInterface file3 = new TextFile("log.text");

        FolderFile file4 = new FolderFile("我的文件");
        file4.add(file1);
        file4.add(file2);
        file4.add(file3);
//        file1.scanFile();

        file4.scanFile();
    }
}
